package com.huang.usercenter.common;

import com.huang.usercenter.Exception.BusinessException;
import com.huang.usercenter.common.BaseResponse;

public class ResultUtil {

    public static <T> BaseResponse<T> success(T data) {
        return new BaseResponse<>(0, data, "", "");
    }

    public static BaseResponse success() {
        return new BaseResponse(200, null);
    }


    public static BaseResponse error(ErrorCode errorCode) {
        return new BaseResponse(400, errorCode.getMessage(), errorCode.getDescription());
    }

    public static BaseResponse error(ErrorCode errorCode, String massage, String Description) {
        return new BaseResponse(errorCode.getCode(), massage, Description);
    }
}
